﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="SendEmail.aspx.cs" Inherits="LizzabethBrownRealEstate.Views.Admin.SendEmail" ValidateRequest="false"  %>
<%@ Import Namespace="LizzabethBrownRealEstate.Models"   %>

<asp:Content ID="Content1" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
    <script type="text/javascript" src="../../Content/javascript/jquery.wysiwyg.js"></script>
    <script type="text/javascript">
       $(document).ready(function(){
        
        $("#Body").wysiwyg({
            controls: {
                underline : {visible : true},
                insertOrderedList : { visible : true },
                insertUnorderedList : { visible : true },
                undo : { visible : true },
                redo : { visible : true },
                cut : { visible : true },
                copy : { visible : true },
                paste : { visible : true },
                h1 : { visible : false },
                h2 : { visible : false },
                h3 : { visible : false }
                }
        }); 
        $("#frmEmail").validate({
                   rules: {
                     Subject: "required"
                   },
                   errorLabelContainer:"#frmMailErr",
                   messages: {
                     Subject: "Please enter a subject."
                   }
                });
            });
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="StylePlaceHolder" runat="server">
    <link href="../../Content/jquery.wysiwyg.css" rel="stylesheet" type="text/css"  />
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <% LBRDataContext dc = new LBRDataContext(); %>
    <div class="contentDiv" style="left:15%">
        <div style="margin-top:20px">
            <form id="frmEmail" method="post" action="<%=  Url.Action("SendMail", "Admin" ) %>" >
                <fieldset style="width:500px">
                    <legend>Send an email...</legend>
                    <table style="margin:20px 0 0 0">
                        <tr class="addPropertyRow">
                            <td class="addPropertyLabel">User&nbsp;Name:</td>
                            <td class="addPropertyField"><%= Html.DropDownList("Select a user...", "User", new SelectList(dc.Users.Where<User>(u => u.Deleted == false).OrderBy<User, String>(user => user.Last), "UserId", "FullName"))%></td>
                        </tr>
                        <tr>
                            <td class="addPropertyLabel">Subject:</td>
                            <td class="addPropertyField"><%= Html.TextBox("Subject", "", new { style = "width: 300px;" })%></td>
                        </tr>
                        <tr>
                            <td class="addPropertyLabel">Body:</td>
                            <td class="addPropertyField"><%= Html.TextArea("Body", "", new { style="width: 400px; height: 300px" })%></td>
                        </tr>
                        <tr>
                            <td colspan="2"><div id="frmMailErr" class="ValidateErrorContainer"></div></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>
                                <input type="submit" id="btnSubmit" name="btnSubmit" value="Send" />&nbsp;&nbsp;&nbsp;&nbsp;
                                <button onclick="window.location='../Admin.ashx/AdminOptions'">Return</button>
                            </td>
                        </tr>
                    </table>
                    
                </fieldset>
                
            </form>
        </div>
    </div>
</asp:Content>
